/**
 * 暂存受理接口api
 * @author: wangwg
 * @date: 2020-11-29
 */
import request from "@/utils/request";

// 分页查询列表操作
export function page(query) {
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + "/zcbl/case/pageTemporaryList",
    method: "get",
    params: query
  });
}

// 获取办件与情形标题选项关系信息
export function getCaseTitleValueList(caseOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/zcbl/caseSituValRel/getCaseTitleValueList?caseOid=" +
      caseOid,
    method: "get"
  });
}

// 获取办件信息
export function queryAllCaseByOid(caseOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/zcbl/case/queryTbCaseByCaseOid?caseOid=" +
      caseOid +
      "&sourceFlag=1",
    method: "get"
  });
}

// 获取证件名称
export function getCertificateTypeByOid(oid) {
  return request({
    url:
      process.env.VUE_APP_BJFW_ROUTE_PATH +
      "/sysDictService/getSysDictByDictOid?dictOid=" +
      oid,
    method: "get"
  });
}

export function intelligentPretrialmaterialPrePrialAll(caseOid) {
  return request({
    url:
      process.env.VUE_APP_ZC_ROUTE_PATH +
      "/preTrial/intelligentPretrialmaterialPrePrialAll",
    params: {
      caseOid: caseOid
    },
    method: "get"
  });
}

export function intelligentPretrialmaterialPrePrial(
  caseOid,
  caseFileRecOid,
  caseMaterialOid,
  cataOid
) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/preTrial/intelligentPretrialmaterialPrePrial",
    params: {
      caseOid: caseOid,
      caseFileRecOid: caseFileRecOid,
      caseMaterialOid: caseMaterialOid,
      cataOid: cataOid
    },
    method: "get"
  });
}

export function intelligentPretrial(caseOid) {
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + "/preTrial/intelligentPretrial",
    params: {
      caseOid: caseOid
    },
    method: "get"
  });
}

export function viewResult(caseOid, caseFileRecOid, caseMaterialOid, cataOid) {
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + "/preTrial/viewResult",
    params: {
      caseOid: caseOid,
      caseFileRecOid: caseFileRecOid,
      caseMaterialOid: caseMaterialOid,
      catalogOid: cataOid
    },
    method: "get"
  });
}

/**
 * 查询当前材料是否绑定共享目录
 * @param materialOid
 */
export function elecHasBindPublic(materialOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/elemLice/elecHasBindPublic?materialOid=" +
      materialOid,
    method: "get"
  });
}

// 保存办件受理信息
export function saveCaseAccpet(data) {
  console.log("进入受理调用接口");
  return request({
    url: process.env.VUE_APP_KSTB_ROUTE_PATH + "/zcbl/case/saveCaseAccpet",
    method: "get",
    params: {
      caseOid: data.get("caseOid"),
      userOid: data.get("userOid"),
      userName: data.get("userName"),
      finalOpinion: data.get("finalOpinion"),
      finalOpinionDesc: data.get("finalOpinionDesc"),
      rqhbTime: data.get("rqhbTime")
    }
  });
}
